package com.example.myapplication.kotlin

fun main() {
    val fish = Fish("金鱼", 1, 10)
    // copy 可以更改数据内容
    val fish2 = fish.copy(name = "鲤鱼")
    // 第二种方法
    val fish3 = Fish(
        price = 300,
        age = 2,
        name = "鲤鱼"
    )
    // 解构
    val (name, age, price) = fish3
    println("name: $name, age: $age, price: $price")
}


data class Fish(
    val name: String,
    val age: Int,
    val price: Int
)